#ifndef FILEGROUPSANDMASKS_H
#define FILEGROUPSANDMASKS_H

#include <wx/arrstr.h>
#include <wx/dynarray.h>
#include <wx/string.h>

struct FileGroups {
  wxString groupName;
  wxArrayString fileMasks;
};

WX_DEFINE_ARRAY( FileGroups*, FileGroupsArray );

class FilesGroupsAndMasks {
  public:
    FilesGroupsAndMasks();
    FilesGroupsAndMasks( const FilesGroupsAndMasks& rhs );
    ~FilesGroupsAndMasks();
    void CopyFrom( const FilesGroupsAndMasks& rhs );
    void SetDefault( bool do_clear = true );
    void Save();
    void Clear();
    unsigned int AddGroup( const wxString& name );
    void RenameGroup( unsigned int group, const wxString& newName );
    void DeleteGroup( unsigned int group );
    void SetFileMasks( unsigned int group, const wxString& masks );
    unsigned int GetGroupsCount() const;
    wxString GetGroupName( unsigned int group ) const;
    wxString GetFileMasks( unsigned int group ) const;
    bool MatchesMask( const wxString& ext, unsigned int group ) const;
  private:
    void Load();
    FileGroupsArray m_Groups;
};

#endif
